home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9854 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: news.den.mmc.com!usenet
  2. From: Steve Howard <howard@mtm.syr.ge.com>
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: Mon, 04 Mar 1996 14:29:50 -0500
  6. Organization: Lockheed Martin Ocean, Radar & Sensor Systems - Syracuse
  7. Message-ID: <313B44AE.4134@mtm.syr.ge.com>
  8. References: <JSA.96Feb16135027@organon.com> <SPENCER.96Feb29102241@zorgon.ERA.COM> <4h5bptINN9oi@anvil.ugrad.cs.ubc.ca> <4hakfl$ogd@fred.netinfo.com.au> <4hf701INNdl7@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: 144.219.108.219
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. Kazimir Kylheku wrote:
  16.  
  17. > Ada compiled code will catch this? My ass. The hardware is supposed to catch
  18. > this, by implementing _at the very least_ a parity bit for detecting single-bit
  19. > alterations in dynamic RAM.  For more robust reliability, you want more bits
  20. > than that so that you can implement Hamming code error correction and
  21. > detection.
  22. > What if the toggled bit is in the middle of an integer or a floating point
  23. > number's sign, mantissa or exponent such that the alteration results in a
  24. > perfectly valid number?
  25. >
  26.  
  27. No, Ada probably won't detect this error.....
  28.   
  29. > How do you know that? Most of the kinds of things you describe (e.g. range
  30. > checking) can be handled by a specialized compiler.
  31. > --
  32.  
  33. They probably _can_ be handled by a specialized C compiler.... but they _will_ be handled
  34. by _every_ Ada compiler. Can I get that from Visual C++? I thought not....
  35.  
  36.  
  37. Of course, one fundamental distinction is that Ada code generally avoids using "pointers", and
  38. therefore is less prone to problems associated with them, while C code uses pointers almost
  39. exclusively. Therefore, the errors mentioned would typically cause data values to be "changed" in Ada, 
  40. rather than  changing pointers and accessing invalid memory in C.
  41.  
  42. It is true that no code should be developed with the assumption that the compiler/run-time will
  43. prevent errors. Experience is always needed to prevent bugs. However, even the best, most experienced,
  44. engineers make mistakes (Kazimir excluded, of course ;) ) Ada compilers and the supporting run-time
  45. systems help to identify these problems early on.
  46.  
  47. -- 
  48. E. Steve Howard                | Lockheed Martin
  49.                                | Ocean, Radar, & Sensor Systems        
  50. mailto:howard@mtm.syr.ge.com   | Syracuse, NY
  51.